/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ADMIN
 */
@Entity
@Table(name = "contactocliente", catalog = "SIESCO", schema = "dbo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Contactocliente.findAll", query = "SELECT c FROM Contactocliente c"),
    @NamedQuery(name = "Contactocliente.findByIdcontacto", query = "SELECT c FROM Contactocliente c WHERE c.idcontacto = :idcontacto"),
    @NamedQuery(name = "Contactocliente.findByIdcliente", query = "SELECT c FROM Contactocliente c WHERE c.idcliente = :idcliente"),
    @NamedQuery(name = "Contactocliente.findByNombrecontacto", query = "SELECT c FROM Contactocliente c WHERE c.nombrecontacto = :nombrecontacto"),
    @NamedQuery(name = "Contactocliente.findByApellidocontacto", query = "SELECT c FROM Contactocliente c WHERE c.apellidocontacto = :apellidocontacto"),
    @NamedQuery(name = "Contactocliente.findByTelefonooficina", query = "SELECT c FROM Contactocliente c WHERE c.telefonooficina = :telefonooficina"),
    @NamedQuery(name = "Contactocliente.findByCelularcontacto", query = "SELECT c FROM Contactocliente c WHERE c.celularcontacto = :celularcontacto"),
    @NamedQuery(name = "Contactocliente.findByEmail", query = "SELECT c FROM Contactocliente c WHERE c.email = :email"),
    
    @NamedQuery(name = "Contactocliente.findByCargocontacto", query = "SELECT c FROM Contactocliente c WHERE c.cargocontacto = :cargocontacto")})
public class Contactocliente implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "idcontacto", nullable = false)
    private Integer idcontacto;
    @Basic(optional = false)
    @NotNull
    @Column(name = "idcliente", nullable = false)
    private int idcliente;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 25)
    @Column(name = "nombrecontacto", nullable = false, length = 25)
    private String nombrecontacto;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 25)
    @Column(name = "apellidocontacto", nullable = false, length = 25)
    private String apellidocontacto;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 20)
    @Column(name = "telefonooficina", nullable = false, length = 20)
    private String telefonooficina;
    @Size(max = 20)
    @Column(name = "celularcontacto", length = 20)
    private String celularcontacto;
    // @Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", message="Invalid email")//if the field contains email address consider using this annotation to enforce field validation
    @Size(max = 50)
    @Column(name = "email", length = 50)
    private String email;
    
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "cargocontacto", nullable = false, length = 50)
    private String cargocontacto;

    public Contactocliente() {
    }

    public Contactocliente(Integer idcontacto) {
        this.idcontacto = idcontacto;
    }

    public Contactocliente(Integer idcontacto, int idcliente, String nombrecontacto, String apellidocontacto, String telefonooficina, String cargocontacto) {
        this.idcontacto = idcontacto;
        this.idcliente = idcliente;
        this.nombrecontacto = nombrecontacto;
        this.apellidocontacto = apellidocontacto;
        this.telefonooficina = telefonooficina;
        
        this.cargocontacto = cargocontacto;
    }

    public Integer getIdcontacto() {
        return idcontacto;
    }

    public void setIdcontacto(Integer idcontacto) {
        this.idcontacto = idcontacto;
    }

    public int getIdcliente() {
        return idcliente;
    }

    public void setIdcliente(int idcliente) {
        this.idcliente = idcliente;
    }

    public String getNombrecontacto() {
        return nombrecontacto;
    }

    public void setNombrecontacto(String nombrecontacto) {
        this.nombrecontacto = nombrecontacto;
    }

    public String getApellidocontacto() {
        return apellidocontacto;
    }

    public void setApellidocontacto(String apellidocontacto) {
        this.apellidocontacto = apellidocontacto;
    }

    public String getTelefonooficina() {
        return telefonooficina;
    }

    public void setTelefonooficina(String telefonooficina) {
        this.telefonooficina = telefonooficina;
    }

    public String getCelularcontacto() {
        return celularcontacto;
    }

    public void setCelularcontacto(String celularcontacto) {
        this.celularcontacto = celularcontacto;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    

    public String getCargocontacto() {
        return cargocontacto;
    }

    public void setCargocontacto(String cargocontacto) {
        this.cargocontacto = cargocontacto;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idcontacto != null ? idcontacto.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Contactocliente)) {
            return false;
        }
        Contactocliente other = (Contactocliente) object;
        if ((this.idcontacto == null && other.idcontacto != null) || (this.idcontacto != null && !this.idcontacto.equals(other.idcontacto))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Contactocliente[ idcontacto=" + idcontacto + " ]";
    }
    
}
